import baseModel from './baseModel'
import { deflateSync } from 'zlib';

class projectModel extends baseModel {

    constructor(options) {
        super(options);
    }
    projectList(currentPage, pageSize) {
        let url = `/api/project/getAll/${currentPage}/${pageSize} `;
        return this.$get(url)
    }

    projectGetAll() {
        let url = `/api/project/getAll`;
        return this.$get(url)
    }

    projectGetAllCount() {
        let url = `/api/project/getAllCount`;
        return this.$get(url)
    }

    getById(id) {
        let url = `/api/project/getById/${id}`;
        return this.$get(url)
    }

    projectAdd(data) {
        let url = ` /api/project/insert`;
        return this.$post(url, data)
    }
    projectDelete(id) {
        let url = ` /api/project/delete/${id}`;
        return this.$get(url)
    }
    projectType() {
        let url = `/api/project/type`;
        return this.$get(url)
    }

    projectUpdate(data) {
        let url = ` /api/project/update`;
        return this.$post(url, data)
    }
    projectCount(data) {
        let url = ` /api/project/query`;
        return this.$post(url, data)
    }

    projectPic(data) {
        let url = ` /api/pic/query`;
        return this.$post(url, data)
    }
    projectPicDel(data) {
        let url = ` /api/pic/delete`;
        return this.$get(url, data)
    }

    getByPrjId(prjId) {
            let url = ` /api/groupInfos/getTreeByPrjId/${prjId}`;
            return this.$get(url)
        }
        // //groupInfos/getByPrjId 通过项目id获取组
        // fromPorjidGet(porjId) {
        //     let url = `/api/groupInfos/getByPrjId/${porjId}`;
        //     return this.$get(url)
        // }
        //根据项目id获取用户
    getUserByPrj(data) {
            let url = ` /api/project/getAllByPrj`;
            return this.$post(url, data)
        }
        //根据用户过滤项目
    queryByUser(data) {
            let url = ` /api/project/queryByUser`;
            return this.$post(url, data)
        }
        //根据项目id和监测类型获取组
    getGroup(data) {
        let url = ` /api/groupInfos/query`;
        return this.$get(url, data)
    }

    insertAdd(data) {
        let url = ` /api/groupInfos/insert`;
        return this.$post(url, data)
    }

    monitorContent() {
        let url = ` /api/monitorContent/getAll`;
        return this.$get(url)
    }

    monitorContentBase(data) {
        let url = ` /api/monitorContent/query`;
        return this.$get(url, data)
    }

    groupInfosId(id) {
        let url = ` /api/groupInfos/getById/${id} `;
        return this.$get(url)
    }

    groupInfosDelete(id) {
        let url = `/api/groupInfos/delete/${id} `;
        return this.$get(url)
    }

    groupInfosUpDate(data) {
        let url = ` /api/groupInfos/update `;
        return this.$post(url, data)
    }

    //测点

    //删除测点与组的关联关系
    devicePointsRemove(data) {
        let url = `/api/devicePoints/Unlink-Group-Point`;
        return this.$get(url, data)
    }

    devicePointsList(data) {
        let url = `/api/devicePoints/query`;
        return this.$get(url, data)
    }

    devicePointsAdd(data) {
        let url = `/api/devicePoints/insert`;
        return this.$post(url, data)
    }

    devicePointsDelete(id) {
        let url = `/api/devicePoints/delete/${id} `;
        return this.$get(url)
    }

    getProjectGroupbyPos(prjId) {
        let url = ` /api/groupInfos/getTreeByPrjId/${prjId}`;
        return this.$get(url)
    }

    getProjectGroupbyType(prjId) {
        let url = ` /api/groupInfos/getTreeForType/${prjId}`;
        return this.$get(url)
    }

    devicePointsUpData(data) {
            let url = `/api/devicePoints/update`;
            return this.$post(url, data)
        }
        //测斜单点
    settleData(data) {
            let url = `/api/settle/data`;
            return this.$post(url, data)
        }
        //测斜多时间点
    settleDatadates(projectId, pointName, date) {
            let url = `/api/settle/data-dates?projectId=${projectId}&pointName=${pointName}&date=${date}`;
            return this.$get(url)
        }
        //settle/data-points 多测点
    settleDatapoints(projectId, pointName, date) {
            let url = `/api/settle/data-points?projectId=${projectId}&pointName=${pointName}&date=${date}`;
            return this.$get(url)
        }
        //上传

    importfile(data) {
        let url = `/api/import/manual-data`;
        return this.$post(url, data)
    }

    //关联测点
    PointBatch(groupId, pids) {
            let url = `api/devicePoints/link-Group-Point-Batch?&groupId=${groupId}&pids=${pids}`;
            return this.$get(url)
        }
        //取消测点
    UnlinkPointBatch(data) {
            let url = `api/devicePoints/Unlink-Group-Point`;
            return this.$post(url, data)
        }
        //项目人员
    getAllMemberByPrjId(id, currentPage, pageSize) {
            let url = `/api/linkUserToPrj/getAllMemberByPrjId/${id}/${currentPage}/${pageSize}`
            return this.$get(url)
        }
        //添加
    memberByAdd(data) {
            let url = `/api/linkUserToPrj/insert`;
            return this.$post(url, data)
        }
        //编辑
    memberByUpdata(data) {
        let url = ` /api/linkUserToPrj/update`;
        return this.$post(url, data)
    }

    //移除项目人员
    memberByRemove(id) {
        let url = `/api/linkUserToPrj/remove/${id}`;
        return this.$get(url)
    }

    //数据分析
    //获取测点列表
    queryPoint(data) {
            let url = `/api/devicePoints/queryPoint`;
            return this.$post(url, data)
        }
        //获取断面列表
    querylandSubsidenceProfile(data) {
        let url = `/api/groupInfos/query`;
        return this.$post(url, data)
    }

    //collect-data
    collectData(data) {
        let url = `/api/devicePoints/collect-data`;
        return this.$post(url, data)
    }

    //幅值分布
    //statisticType  1 表示幅值分布统计 2 表示时间分布统计

    collectDataStatistic(data) {
        let url = `/api/devicePoints/collect-data-statistic`;
        return this.$post(url, data)
    }

    //报表report/day
    reportDay(data) {
        let url = `/api/report/day`;
        return this.$post(url, data)
    }

    //周报report/week
    reportWeek(data) {
        let url = `/api/report/week`;
        return this.$post(url, data)
    }

    //月报report/month
    reportMonth(data) {
        let url = `/api/report/month`
        return this.$post(url, data)
    }

    // 监测方案
    planIdPage(data) {
        let url = `/api/plan/query`
        return this.$get(url, data)
    }
    delPlan(data) {
        let url = `/api/plan/delete`
        return this.$get(url, data)
    }

}

export default projectModel;